/***************************************************************************
 *                                                                         *
 *   This file is part of the CrystalMem project,                          *
 *       http://code.google.com/p/crystalmem                               *
 *                                                                         *
 *   Copyright (C) 2008 by Alberto Scarpa <scarpa.alberto@gmail.com>       *
 *   Copyright (C) 2008 by Enrico Ros <enrico.ros@gmail.com>               *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef __MemoryView_h__
#define __MemoryView_h__

#include "GLGraphicsView.h"
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QSize>
class MemoryTree;
class MemoryTreeItem;

class MemoryView : public GLGraphicsView {
    Q_OBJECT
    public:
        MemoryView( MemoryTree * memTree, QWidget * parentWidget = 0 );
        ~MemoryView();

        // ::QWidget
        QSize sizeHint() const;

    protected:
        // ::GLGraphicsView
        void resizeEvent( QResizeEvent * event );
        void updateDynamics( double dT );
        void viewDrag( DragType dragType, QGraphicsSceneDragDropEvent * event );
        void keyPressed( const QString & keyText );

    private:
        MemoryTree *    m_memTree;
        bool            m_inited;
        MemoryTreeItem * m_memTreeItem;
        QString         m_lastKeys;

    private Q_SLOTS:
        void slotTemp();
};

#endif
